package com.zzl.admin;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;

/**
 * description: 项目应用主类（SpringBoot入口类）
 * @author 朱正磊
 * @date 2019-12-04 10:10:49
 */
@Slf4j
@EnableCaching
@EnableScheduling
@SpringBootApplication
@EnableTransactionManagement
@ComponentScan({"com.zzl.admin", "com.gitee.yongzhuzl.commonutil"})
public class AdminApplication {

    /**
     * description：入口方法
     * user 朱正磊
     * time 2019-03-25 17:09
     */
	public static void main(String[] args) throws Exception {
        ConfigurableApplicationContext context = SpringApplication.run(AdminApplication.class, args);

        DataSource dataSource = context.getBean(DataSource.class);
        log.info("【使用的数据源】DataSource = {}", dataSource.getClass());

        CacheManager cacheManager = context.getBean(CacheManager.class);
        log.info("【使用的缓存框架】CacheManager = {}", cacheManager.getClass());

        log.info("【SpringBoot 启动成功！】");
	}

}
